/*
 * Created on Dec 1, 2003
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package alloy.parse;

import alloy.ast.Id;
import alloy.ast.Path;

/**
 * @author Edmond Lau
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class TypeElementAndPath {
    private Id _typeElement;
    private Path _path;
    
    TypeElementAndPath(Id typeElement_, Path path_) {
        _typeElement = typeElement_;
        _path = path_;
    }   
    
    public Id getTypeElement() {
        return _typeElement;
    }
    
    public Path getPath() {
        return _path;
    }
    
    public boolean equals(Object o) {
        if (o == null || !(o instanceof TypeElementAndPath)) {
            return false;
        }
        TypeElementAndPath pair = (TypeElementAndPath)o;
        return pair._typeElement.equals(_typeElement)  &&
               pair._path.equals(_path);
    }
    
    public int hashCode() {
        return 13*_typeElement.hashCode() + 17*_path.hashCode();   
    }
    
    public String toString() {
        return "(" + _typeElement.toString() + ", " + _path.toString() + ")";
    }
}
